/***********************************************************************
 * Module:  DocumentView.java
 * Author:  Nikola
 * Purpose: Defines the Class DocumentView
 ***********************************************************************/

package genedit.view;

import genedit.model.graph.GraphDocument;

import java.util.Observable;
import java.util.Observer;

import javax.swing.JComponent;

public abstract class DocumentView implements Observer {
	protected double zoomFactor;

	protected JComponent workArea;
	protected GraphDocument model;

	/** @param model */
	public DocumentView(GraphDocument model) {
		this.model = model;
		model.getObservable().addObserver(this);
		this.zoomFactor = 1.1;
	}

	public double getZoomFactor() {
		return zoomFactor;
	}

	/** @param newZoomFactor */
	public void setZoomFactor(double newZoomFactor) {
		zoomFactor = newZoomFactor;
	}

	public abstract void update(Observable o, Object arg);

	public JComponent getWorkArea() {
		return workArea;
	}

	public void setWorkArea(JComponent newJComponent) {
		this.workArea = newJComponent;
	}

	public GraphDocument getModel() {
		return model;
	}

	public void setModel(GraphDocument newGraphDocument) {
		this.model = newGraphDocument;
	}

}